//-----------------------------------------------------------------------
// <copyright file="TypingIMAddressCollection.cs" company="Microsoft">
//     Copyright (c) Microsoft Corporation.  All rights reserved.
// </copyright>
//-----------------------------------------------------------------------

namespace Microsoft.Live.Messenger
{
    using System;

    /// <summary>
    /// Contains the instant messaging addresses that are typing within the <c>Conversation</c>.
    /// </summary>
    public sealed class TypingIMAddressCollection : Collection
    {
        /// <summary>
        /// Initializes a new instance of the <see cref="TypingIMAddressCollection"/> class.
        /// </summary>
        internal TypingIMAddressCollection(object obj, User user)
            : base(obj, user)
        {
        }

        /// <summary>
        /// Gets the <c>IMAddress</c> at the specific index.
        /// </summary>
        /// <param name="index">The zero-based index of the <c>IMAddress</c> to get.</param>
        /// <returns>The <c>IMAddress</c> at the specified index.</returns>
        public IMAddress this[int index]
        {
            get { return (IMAddress)this.GetItem(index); }
        }

        internal override object FindOrCreate(MessengerEntity entity)
        {
            return this.User.IMAddressFactory.FindOrCreate(entity);
        }
    }
}